import { Entity, Column, Index } from 'typeorm';
import { BaseEntity } from '../../base/entity/base';

/**
 * 训练日志
 */
@Entity('class_train_log')
export class ClassTrainLogEntity extends BaseEntity {
  @Index()
  @Column({ comment: '学生ID', default: 0 })
  studentId: number;

  @Index()
  @Column({ comment: '班级ID', default: 0 })
  classId: number;

  @Column({ comment: '时间' })
  time: Date;

  @Column({ comment: '类型', dict: ['购买', '消耗', '充值', '赠送'], default: 0 })
  type: number;

  @Column({ comment: '次数' })
  count: number;

  @Column({ comment: '训练次数' })
  trainCount: number;

  @Column({ comment: '赠送次数' })
  giftCount: number;

  @Index()
  @Column({ comment: '操作人ID' })
  operatorId: number;

  @Column({ comment: '备注', nullable: true })
  remark: string;
}
